﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Domain.Entities;

namespace Himp.TaskScheduling
{
    /// <summary>
    /// 参数配置
    /// </summary>
    public class ParamConfig : Entity<long>
    {
        /// <summary>
        /// 参数类别
        /// 类
        /// 对象
        /// 属性
        /// </summary>
        public EnumParamType ParamType { get; set; }

        /// <summary>
        /// 参数编码
        /// </summary>
        public string ParamCodg { get; set; }

        /// <summary>
        /// 参数名称
        /// </summary>
        public string ParamName { get; set; }

        /// <summary>
        /// 属性Key
        /// </summary>
        public string? PropertyKey { get; set; }

        /// <summary>
        /// 属性类别
        /// 0 string
        /// 1 int
        /// 2 float
        /// </summary>
        public int? PropertyType { get; set; }

        /// <summary>
        /// 参数值
        /// </summary>
        public string? ParamValue { get; set; }

        /// <summary>
        /// 默认值
        /// </summary>
        public string? DefValue { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public string? KeyPath { get; set; }

        /// <summary>
        /// 有效标识
        /// </summary>
        public bool ValiFlag { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public long? ParentId { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public ParamConfig? Parent { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public List<ParamConfig> Children { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public ParamConfig()
        { }

        public ParamConfig(EnumParamType paramType, string paramCodg, string paramName
            , string? propertyKey, int? propertyType)
        {
            ParamType = paramType;
            ParamCodg = paramCodg;
            ParamName = paramName;
            PropertyKey = propertyKey;
            PropertyType = propertyType;
            ValiFlag = true;
        }
    }
}
